{% extends "base_generic.html" %}
{% load i18n %}
{% block content %}
<h1>{% trans "Manage Favorite Groups" %}</h1>
<form method="post">
  {% csrf_token %}
  {{ form.as_p }}
  <button type="submit" class="btn btn-primary btn-sm">{% trans "Add Group" %}</button>
</form>
<ul>
  {% for group in groups %}
    <li>
      <span style="display:inline-block;width:16px;height:16px;background:{{ group.color }};border-radius:3px;margin-right:4px;"></span>
      {{ group.name }}
      <a href="{% url 'catalog:rename-favorite-group' group.pk %}" class="btn btn-sm btn-info">{% trans "Rename" %}</a>
      <a href="{% url 'catalog:delete-favorite-group' group.pk %}" class="btn btn-sm btn-danger">{% trans "Delete" %}</a>
      <a href="{% url 'catalog:move-favorite-group' group.pk 'up' %}" class="btn btn-sm btn-secondary">↑</a>
      <a href="{% url 'catalog:move-favorite-group' group.pk 'down' %}" class="btn btn-sm btn-secondary">↓</a>
      <a href="{% url 'catalog:public-favorite-group' group.share_uuid %}" target="_blank" class="btn btn-sm btn-success">{% trans "Share" %}</a>
    </li>
  {% endfor %}
</ul>
{% endblock %} 